home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 December / macformat-057.iso / mac / Shareware Plus / System components / Desktop Pictures Grab Bag / Random Desktop Picture < prev    next >
Encoding:
Text File  |  1997-09-02  |  604 b   |  19 lines  |  [TEXT/ToyS]

  1. try
  2.     tell application "Finder"
  3.         activate
  4.         --your path to the picture folder goes below between the Quotes
  5.         set fileList to every file of ¬
  6.             folder "Macintosh HD:Apple Extras:Sample Desktop Pictures:" whose ¬
  7.             file type obsolete is "JPEG" or ¬
  8.             file type obsolete is "PICT" as list
  9.         set howMany to the number of items in fileList
  10.         get random number howMany
  11.         set theOne to the result
  12.         tell application "Desktop Pictures" to ¬
  13.             set desktop picture to alias (item theOne of fileList as text)
  14.         tell application "Desktop Pictures" to quit
  15.         set fileList to {}
  16.     end tell
  17. on error
  18.     beep 3
  19. end try